<template>
  <div class="register">
    <div class="register_content">
      <!-- 页头 -->
      <el-page-header @back="goBack" content="注册"></el-page-header>
      <div class="register_content_box">
        <aform :ruleForm="ruleForm" @hello="editRule"></aform>
      </div>
    </div>
  </div>
</template>

<script>

import aform from '../../components/form/index.vue'
export default {
  created(){
        var lastRule = JSON.parse(localStorage.getItem("ruleFrom"));
        console.log(lastRule);
        this.ruleForm=lastRule; 
    },
  data(){
    return{
      ruleForm:''
    }
  },
   methods:{    
    goBack() {
      console.log("go back");
      this.$router.push("/");
    },
    editRule(ruleForm){
        this.ruleForm=ruleForm;
        console.log(ruleForm);
        localStorage.setItem('ruleFrom',JSON.stringify(this.ruleForm));
        this.$router.go(0);     
    }
   },
  components:{
     aform
  }
};
</script>

<style lang="less" scoped>
@import "./index.less";
</style>